import request from '@/util/ProRequest'

// 获取权限列表
export function getProductionOrderList(pageNum,pageSize,productionOrder) {
    return request({
        url: '/productionOrder/list',
        method: 'get',
        params:{
            pageNum,
            pageSize,
            ...productionOrder
        }
    })
}

export function addProductionOrder(data) {
    return request({
        url: '/productionOrder/add',
        method: 'post',
        data
    })
}

export function updateProductionOrder(data) {
    return request({
        url: '/productionOrder/update',
        method: 'put',
        data
    })
}

export function queryById(id) {
    return request({
        url: `/productionOrder/id/${id}`,
        method: 'get'
    })
}
export function queryByCode(productionOrderCode) {
    return request({
        url: `/productionOrder/productionOrderCode/` + productionOrderCode,
        method: 'get'
    })
}
export function deleteProductionOrder(id) {
    return request({
        url: `/productionOrder/delete/${id}`,
        method: 'delete'
    })
}

export function batchDeleteProductionOrder(ids) {
    return request({
        url: '/productionOrder/batchDelete?'+ids,
        method: 'delete',
    })
}
// 获取自动生成的编号
export function getAutoCode() {
    return request({
        url: '/productionOrder/autoCode',
        method: 'get'
    })
}
export function updateStatusById(id) {
    return request({
        url: `/productionOrder/update/${id}`,
        method: 'put'
    })
}
export function updateStatusById2(id) {
    return request({
        url: `/productionOrder/update2/${id}`,
        method: 'put'
    })
}
export function updateStatusById3(id) {
    return request({
        url: `/productionOrder/update3/${id}`,
        method: 'put'
    })
}
export function getProductionOrderListStatus(pageNum,pageSize,productionOrder) {
    return request({
        url: '/productionOrder/list',
        method: 'get',
        params:{
            pageNum,
            pageSize,
            ...productionOrder
        }
    })
}
export function selectWorkflowById(id) {
    return request({
        url: `/productionOrder/workflows/${id}`,
        method: 'get'
    })
}
export function selectByProductionOrderCode(productionOrderCode) {
    return request({
        url: `/productionOrder/productionOrderCode/${productionOrderCode}`,
        method: 'get'
    })
}